import request from '@/utils/request'
import environment from '@/environment'
import storage from "@/utils/storage.js"
import {
	appInfo
} from "@/config.js"

export function internalMessageList(data,page={
					pageNum: 1,//第几页
					pageSize: 5,//显示多少条
				}) {
	let currentEnv = storage.get("env") || appInfo.env
	return request({
		'url': `${environment[currentEnv]['common']}/common/api/v1/internalMessage/list?page=${page.pageNum}&size=${page.pageSize}`,
		'method': 'post',
		'data':data
	})
}

export function getUnReadList(bizType) {
	let currentEnv = storage.get("env") || appInfo.env
	return request({
		'url': `${environment[currentEnv]['common']}/common/api/v1/internalMessage/getUnReadNum/${bizType}`,
		'method': 'get',
	})
}


export function messageReadOne(uid) {
	let currentEnv = storage.get("env") || appInfo.env
	return request({
		'url': `${environment[currentEnv]['common']}/common/api/v1/internalMessage/readOne/${uid}`,
		'method': 'get',
	})
}





